using System;
using System.Collections.Generic;
using System.BusinessObjects.Data;
using System.Data;
using Iesi.Collections.Generic;
using System.Xml.Serialization;
using Blazing.BusinessObjects.Tagging;

namespace Blazing.BusinessObjects.Cms
{
    [Serializable]
    public class Menu : DataObject<Menu>
    {
        public virtual int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        [NonSerialized]
        MenuType _menuType;
        public virtual MenuType MenuType
        {
            get
            {
                return _menuType;
            }
            set
            {
                BeginEdit();
                _menuType = value;
            }
        }

        public virtual string Name
        {
            get { return GetValue<string>("Name"); }
            set
            {
                BeginEdit();
                SetValue("Name", value);
            }
        }

        public virtual string Description
        {
            get { return GetValue<string>("Description"); }
            set
            {
                BeginEdit();
                SetValue("Description", value);
            }
        }

        [NonSerialized]
        Site _site;
        public virtual Site Site
        {
            get
            {
                return _site;
            }
            set
            {
                BeginEdit();
                _site = value;
            }
        }

        [NonSerialized]
        private ISet<TaxonomyTag> _menuTaxonomyTags = new HashedSet<TaxonomyTag>();
        public virtual ISet<TaxonomyTag> MenuTaxonomyTags
        {
            get
            {
                return _menuTaxonomyTags;
            }
            set
            {
                BeginEdit();
                _menuTaxonomyTags = value;
            }
        }

        public virtual string Prefix
        {
            get { return GetValue<string>("Prefix"); }
            set
            {
                BeginEdit();
                SetValue("Prefix", value);
            }
        }

        [NonSerialized]
        private ISet<MenuItem> _childMenuItems = new HashedSet<MenuItem>();
        [XmlIgnore]
        public virtual ISet<MenuItem> ChildItems
        {
            get
            {
                return _childMenuItems;
            }
            set
            {
                _childMenuItems = value;
            }
        }

        public virtual DateTime RowStamp
        {
            get { return GetValue<DateTime>("RowStamp"); }
            set
            {
                SetValue("RowStamp", value);
            }
        }
       
    }
}
